package com.sayimo.maker.user.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sayimo.framework.database.mybatis.AbstractMybatisBaseDao;
import com.sayimo.framework.exception.DaoException;
import com.sayimo.maker.user.dao.StartupGameInterfaceDao;
import com.sayimo.maker.user.vo.StartupGame;



/**
 * 
 * @Project: schoolmallapi
 * @ClassName: StartupGameInterfaceImplDao
 * @Description: 创客大赛daoimpl
 * @author:	曹频辉
 * @date:	日期：2016年4月20日  时间：下午2:49:02
 * @version 1.0.0
 */
@Repository(value="startupGameInterfaceImplDao")
public class StartupGameInterfaceImplDao  extends AbstractMybatisBaseDao<StartupGame> implements StartupGameInterfaceDao{
	/**
	 * 
	* @Title: getRankInfoByCustomerId 
	* @Description: 获取当前会员的爱心值
	* @param customerId
	* @param type
	* @return
	* @throws DaoException
	* @return Map<String,Object>
	* @throws
	 */
	@Override
	public Map<String, Object> getRankInfoByCustomerId(Integer customerId,
			Integer type) throws DaoException {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("customerId", customerId);
		map.put("type", type);
		return (Map<String, Object>)this.mybatisInterfaceBaseDao.getObject("com.sayimo.maker.user.dao.StartupGameInterfaceDao.getRankInfoList", map);
	}

	
	/**
	 * 
	* @Title: getRankInfoListByType 
	* @Description: 获取排名列表
	* @param type
	* @return
	* @throws DaoException
	* @return List
	* @throws
	 */
	@Override
	public List getRankInfoListByType(Integer type) throws DaoException {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("type", type);
		map.put("customerId", null);
		return this.mybatisInterfaceBaseDao.queryObject("com.sayimo.maker.user.dao.StartupGameInterfaceDao.getRankInfoList", map);
	}
	
	/**
	 * 
	* @Title: judgeIsStudentByCustomerId 
	* @Description: 判断是否是学生
	* @param customerId
	* @return
	* @throws DaoException
	* @return Integer
	* @throws
	 */
	@Override
	public Integer judgeIsStudentByCustomerId(Integer customerId)
			throws DaoException {
		return this.mybatisInterfaceBaseDao.queryCount("com.sayimo.maker.user.dao.StartupGameInterfaceDao.isStudent",customerId);
	}
}
